<?php
//引入核心的库文件
include_once "smarty-3.1.33/libs/Smarty.class.php";
//实例化模板引擎对象
$smarty=new Smarty();
//编译文件目录
$smarty->setCompileDir("smarty/compile");
//缓存目录
$smarty->setCacheDir("smarty/cache");
//配置文件
$smarty->setCacheDir("smerty/config");
//模板文件 专门存放html文件
$smarty->setTemplateDir("smarty/template");
//设置一个变量给页面
$smarty->assign("username","李四");
//设置一个数组给页面
$arr=["a","b","c"];
$arr2=["a"=>1,"B"=>2,"C"=>3];

$smarty->assign("arr",$arr);
$smarty->assign("arr2",$arr2);

//渲染页面
$smarty->display("test.html");
